<template>
    <van-search v-model="value" show-action
        label="地址                                                                                                                                                                                                                                                                                                                                                                           "
        placeholder="请输入搜索关键词" @search="onSearch">
        <template #action>
            <div @click="onClickButton">搜索</div>
        </template>
    </van-search>
    <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="image in images" :key="image">
            <img :src="image" style="width: 100%;height: 200px;" />
        </van-swipe-item>
    </van-swipe>
    <van-grid>
        <van-grid-item v-for="item in catitemsApiData" :icon="item.image_src" :text="item.name" />
    </van-grid>
   <div style="height: 400px;">
     <img src="../views/img/首页_03.gif" alt="" style="width: 100%;height: 200px;"></img>
     <p style="font-weight: bold;"><span>配件套餐至高立减200元</span>|<span>享6期免息</span>|<span>以旧换新至高免单</span></p>
   </div>
</template>

<script setup>
import { catitemsApi } from '@/api/api';
import { ref } from 'vue';
let catitemsApiData = ref([])
catitemsApi().then(res => {
    console.log('导航数据',res)
    catitemsApiData.value = res.data.message
})
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
</script>

<style lang="scss" scoped></style>